import Vue from 'vue'
import Router from 'vue-router'
import axios from 'axios';
Vue.prototype.$axios = axios;
//用户
import login from '@/user/login'
import signup from '@/user/signUp'
import sendEmail from '@/user/sendEmail'
import resetPwd from '@/user/resetPwd'
import resendEmail from '@/user/resendEmail'
import personalPage from '@/user/personalPage'
//用户协议
import userProtocol from '@/user/userProtocol'
//隐私协议
import privacyAgreement from '@/user/privacyAgreement'
//一般页面
import home from '@/page/home'
import dashboard from '@/page/dashboard'
import templateDetail from '@/page/model/template'
import modelDetail from '@/page/model/model'
import editorSource from '@/page/editorSource'
import createTemplate from '@/page/createTemplate'
import resource from '@/page/resource'
//帮助文档
import helpDocument from '@/page/helpDocument'

//智能建模
import uploadData from '@/page/smart/upload'
import dataDetails from '@/page/smart/dataDetails'
import task from '@/page/smart/task'
import dataBasicAnalysis from '@/page/smart/dataBasicAnalysis'
import analysisResults from '@/page/smart/analysisResults'
//手动建模
import buildStep from '@/page/manual/buildStep'
//报告
import templateReport from '@/page/model/templateReport'
import modelReport from '@/page/model/modelReport'

//测试
import Table from '@/page/table'
Vue.use(Router)


export default new Router({
	//mode: 'history',
  	routes: [
	  	{
	      path: '/',
	      component: home,
	      meta: {
	        title: '首页'
	   	  }
	    },	    
	    {
	      path: '/login',
	      name: 'login',
	      component: login,	     
	    },
	    {
	      path: '/helpDocument',
	      name: 'helpDocument',
	      component:helpDocument,	     
	    },
	    {
	      path: '/signup',
	      name: 'signup',
	      component: signup
	    },
	    {
	      path: '/sendEmail',
	      name: 'sendEmail',
	      component: sendEmail
	    },
	    {
	      path: '/resetPwd/:username/:token',	      
	      name: 'resetPwd',
	      component: resetPwd,
	      mate:{
	      	title:'重置密码'
	      }
	      
	    },
	    {
	      path: '/userProtocol',	      
	      name: 'userProtocol',
	      component: userProtocol	      
	    },
	    {
	      path: '/privacyAgreement',	      
	      name: 'privacyAgreement',
	      component: privacyAgreement	      
	    },
	    {
	    	path: '/resendEmail/:email',
	     	name: 'resendEmail',
	      	component: resendEmail,
	      	mate:{
		      	title:'再次发送邮件'
		    }
	    },

	    {
	    	path: '/user/personalPage/:username',
	     	name: 'personalPage',
	      	component: personalPage
	    },
	    {
	      path: '/dashboard',
	      component: dashboard,
	      name: 'dashboard',
	      meta:{requiresAuth:true}	       
	    },
	    {
	      path: '/dashboard/table',
	      name: 'Table',
	      component: Table,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/createTemplate/:path/:id',
	      name: 'createTemplate',
	      component: createTemplate,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/model/template/:id/:name',
	      name: 'templateDetail',
	      component: templateDetail,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/model/model/:id/:name',
	      name: 'modelDetail',
	      component: modelDetail,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/model/templateReport/:id/:node',
	      name: 'templateReport',
	      component: templateReport,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/model/modelReport/:id/:node',
	      name: 'modelReport',
	      component: modelReport,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/editorSource/:id',
	      name: 'editorSource',
	      component: editorSource,
	      meta:{requiresAuth:true}
	    },
	    {	    	
	      path: '/resource',
	      name: 'resource',
	      component: resource,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/smart/upload',
	      name: 'uploadData',
	      component: uploadData,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/smart/dataDetails/:id/:name',
	      name: 'dataDetails',
	      component: dataDetails,
	      meta:{requiresAuth:true}
	    },
	     {   
	      path: '/dataBasicAnalysis/:id/:node',
	      name: 'dataBasicAnalysis',
	      component: dataBasicAnalysis,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/smart/task/:id',
	      name: 'task',
	      component: task,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/smart/analysisResults/:id',
	      name: 'analysisResults',
	      component: analysisResults,
	      meta:{requiresAuth:true}
	    },
	    {
	      path: '/manual/buildStep/:key/:tem/:model/:path',
	      name: 'buildStep',
	      component: buildStep,
	      meta:{requiresAuth:true}
	    }
	    
  	]
})
